<template>
  <div style="background:#f3f3f3">
    <header class="mint-header" style="font-size: 18px;">
      <div class="mint-header-button is-left">
        <button class="mint-button mint-button--default mint-button--normal" style="font-size: 15px;" @click="goback">
          <span class="mint-button-icon">
            <i class="mintui mintui-back" />
          </span>
          <label class="mint-button-text">返回</label>
        </button>
      </div>
      <h1 class="mint-header-title">期间核查</h1>
      <div class="mint-header-button is-right" />
    </header>
    <!-- <div style="height:40px"></div> -->
    <mt-search v-model="ep_ename" cancel-text="取消" placeholder="查询" @focus.native.capture="loadListData" />

    <div v-if="intermed.length==0">
      <img :src="zan" alt style="width:100%">
      <div style="text-align:center;color:#35495e">暂无相关内容</div>
    </div>
    <div class="box">
      <div v-for="(item, index) in intermed" :key="index" class="equi-div1">
        <div class="equi-left">
          <h3 class="h3_equi">{{ item.hash.ep_ename }}</h3>
          <div class="equi-div" style="display:flex;color:#000;">
            <span class="equi-span2">管理编号：{{ item.hash.managenum }}</span>｜
            <span class="equi-span2">型号：{{ item.hash.scale }}</span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              责任部门：
              <span class="equi-span">{{ item.hash.duty_org }}</span>
            </span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              <span class="equi-span2">检查方法：{{ item.hash.check_method }}</span>
            </span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              检查实施日期：
              <span class="equi-span">{{ item.hash.check_time }}</span>
            </span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              <span class="equi-span2">本次检定/校准日期：{{ item.hash.verifiytime }}</span>
            </span>
          </div>
        </div>
        <div class="equi-xq" @click="goequiinfo(item)">核查结果</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  data () {
    return {
      intermed: [],
      ts: this.newStore(),
      zan: 'zanwu.png',
      popupVisible22: false,
      ep_ename: '',
      shebeilist: [],
      dataList: [
        {
          flex: 1,
          values: [],
          className: 'slot1',
          textAlign: 'right'
        }
      ],
      chousname: [],
      chouseval: '',
      chouseid: '',
      htitle: '期间核查'
    }
  },
  created () {
    this.intermedlist()
  },
  methods: {
    goequiinfo (item) {
      this.$router.push({
        name: 'intermaered',
        query: { id: item.hash.id, eid: item.hash.eid }
      })
    },
    intermedlist () {
      const req = {
        handle:
          'DD5D108B99FC12B7BAB3E6EAE5C936EF5FBB6F4BAE9BBB73CD3A43E9777C4E90',
        charger: localStorage.getItem('pid')
      }
      this.spost(this.ts, '/mainservlet', req).then(ts => {
        if (ts.d.sflag == 'success') {
          this.intermed = ts.d.data.operation1
        }
      })
    },
    click () {
      alert('123')
    },
    getlist () {
      const req = {
        handle: 'DD5D108B99FC12B72DC0B97F927BBE3D1A8639331D9DCC49',
        limit: 100000
      }
      this.spost(this.ts, '/mainservlet', req).then(ts => {
        if (ts.d.sflag == 'success') {
          let a = []
          let b = []
          for (let i = 0; i < ts.d.data.operation1.length; i++) {
            a.push(ts.d.data.operation1[i].hash.ep_ename)
            b.push(ts.d.data.operation1[i].hash)
            //a[m] = { carid: ts.d.data.operation1[m].hash.carno }
          }
          this.dataList[0].values = a
          this.chousname = b
          console.log(this.chousname, 'wwwww')
          // this.shebeilist = ts.d.data.operation1
        }
      })
      this.popupVisible22 = true
    },
    goback () {
      this.$router.push({
        name: 'jbrhome'
      })
    },
    handleConfirm2 () {
      //this.chouseval = this.$refs.picker.getValues()[0]
      this.popupVisible22 = false
    },
    onDateChange (picker, values) {
      //   console.log(picker, 123456)
      //   console.log(values, 123)
      this.chouseval = values
      console.log(picker, 'values')

      for (let k = 0; k < this.chousname.length; k++) {
        if (this.chouseval == this.chousname[k].ep_ename) {
          this.chouseid = this.chousname[k].id
        }
      }
      console.log(this.chouseid, 'this.chouseid')
    },
    //查询
    loadListData () {
      const req = {
        handle:
          'DD5D108B99FC12B7BAB3E6EAE5C936EF5FBB6F4BAE9BBB73CD3A43E9777C4E90',
        eid: this.chouseid,
        charger: localStorage.getItem('pid'),
        ep_ename: this.ep_ename,
        start: 0,
        limit: 10
        //username: localStorage.getItem('username')
      }
      this.spost(this.ts, '/mainservlet', req).then(ts => {
        if (ts.d.sflag == 'success') {
          this.intermed = ts.d.data.operation1
        }
      })
      //this.getlist()
    }
  }
}
</script>
<style scoped>
.equi-div {
  font-size: 12px;
  line-height: 25px;
  color: #000;
}
.equi-shebei {
  display: inline-block;
  font-size: 12px;
  padding: 1px 5px;
  transform: scale(0.9);
  color: #fff !important;
  background: rgb(51, 51, 51);
}
.h3_equi {
  font-size: 16px;
  font-weight: 400;
  line-height: 40px;
}
.equi-span2 {
  width: calc(calc(100% / 2) - 10px);
}
.equi-div1 {
  font-size: 16px;
  line-height: 25px;

  margin: 0 10px;
  text-align: left;
}
.equi-span {
  color: #000;
}
.equi-xq {
  line-height: 130px;
  /* padding-left: 20px; */
  color: #26a2ff;
  float: right;
  /* background: #ddd; */
  margin-top: 27px;
  padding-left: 10px;
  border-left: 1px solid #ddd;
}
.equi-left {
  width: 75%;
  float: left;
  padding-right: 0px;
  margin-right: 10px;
}
.mint-search {
  height: 7vh;
}
.mint-searchbar {
  background-color: #ddd;
}
</style>
